<?php
namespace app\common\validate;

use think\Validate;

class PostValidate extends Validate{

    protected $rule = [
        'title'=>'require',    //名称可以相同 因为有分组
        'pc_id'=>'number',
        'content'=>'require'
    ];

    protected $message = [
        'name.require'=>'标题必填',
        'pc_id.number'=>'分类选择错误',
        'content.require'=>'内容必填'
    ];

    protected $scene = [
        'add' => ['title','pc_id','content'],
        'edit' => ['title','pc_id','content'],
    ];
}